define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");

	var Model = function(){
		this.callParent();
	};

	Model.prototype.modelLoad = function(event){
	    
	   //  window.=window.roomurl;
	  // window.location.href=window.roomurl;
	 // var tong=this;
       this.getElementByXid("iframe").src = window.roomurl+'?user=1';
       setTimeout(this.yanche(),2000); 
     // window.open (window.roomurl,'newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
	};
    Model.prototype.yanche=function(){
      $.ajax({
        type: "GET",
        url: window.yuming+'/videoconnects/vc/return?hid='+window.hid+'&login-token='+window.token+'&ifOrNot=1',     
        async: false,
        cache: false,

        success: function(datas){
               
            },
        error: function(XMLHttpRequest){

          alert("请求服务失败")
        }
        })
    }
	Model.prototype.cancelBtnClick = function(event){
	  
        $.ajax({
        type: "GET",
        url: window.yuming+'/videoconnects/vc/stop?id='+window.roomid+'&login-token='+window.token,     
        async: true,
        cache: false,

        success: function(datas){
               
             //  justep.Shell.showPage("main");
             
            },
        error: function(XMLHttpRequest){

         
        }
    });
     this.close();
	};

	return Model;
});